package com.wushijia.datastructure;

public class Matrix
{
    private int value[][];                   

    public Matrix(int m, int n)                
    {
        this.value=new int[m][n]; 
    }
    public Matrix(int n)                   
    {
        this(n,n); 
    }
    public Matrix()
    {
        this(10,10);
    }
    public Matrix(int mat[][])          
    {
        this(mat.length,mat[0].length);
        for (int i=0; i<mat.length; i++)
            for (int j=0; j<mat[i].length; j++)
               this.value[i][j] = mat[i][j];
    }

    public int get(int i, int j)          
    {
        return value[i][j];
    }
    public void set(int i, int j, int k)    
    {
        value[i][j]=k;
    }

    public Matrix add(Matrix a)          
    {
    	if(this.value.length==a.value.length&&this.value[0].length==a.value[0].length)
    	{
    		Matrix c = new Matrix(this.value.length,this.value[0].length);
        	for (int i=0; i<this.value.length; i++)
            	for (int j=0; j<this.value[i].length; j++)
               		c.value[i][j] = this.value[i][j]+a.value[i][j];
        	return c;    		
    	}
    	else
    		return null;
    }
    
    public String toString()            
    {
        String str="";
        for (int i=0; i<value.length; i++)
        {
            for (int j=0; j<value[i].length; j++)
                str += "  "+value[i][j];
            str += "\n";
        }
        return str;
    }
    
    //transpose��������Ӵ��룬��ǰ����this��ת�þ���
    public Matrix transpose()
    {
    	Matrix c=null;
		//��Ӵ���ʵ��ת�á�
		return c;	
    }
    
    //multiply��������Ӵ���ʵ�־���this�;���a��ˡ�����Ǿ���c
    public Matrix multiply(Matrix a)
    {
    	Matrix c=null;
		//��Ӵ���ʵ����ˡ�
		return c;	
    }
    
    //isSymmetricMatrix��������Ӵ��룬�ж�this�Ƿ�Ϊ�Գ���
    public boolean isSymmetricMatrix()
    {
    	boolean b=false;
		//��Ӵ���ʵ���жϡ�
		return b;	
    }
    
    //isUpperTriangularMatrix��������Ӵ��룬�ж�this�Ƿ�Ϊ�����Ǿ���
    public boolean isUpperTriangularMatrix()
    {
    	boolean b=false;
		//��Ӵ���ʵ���жϡ�
		return b;	
    }
    
    //equals��������Ӵ��룬�Ƚ���������this��a�Ƿ����
    public boolean equals(Matrix a)
    {
    	boolean b=false;
		//��Ӵ���ʵ���жϡ�
		return b;		
    }
}